#include "cvrmlimporter.h"

#include <buola/scene/ctransform.h>
#include <buola/io/cfile.h>

#include "vrml/cparser.h"

namespace buola { namespace scene { namespace import {

CVRMLImporter::CVRMLImporter()
{

}

CVRMLImporter::~CVRMLImporter()
{
}

PTransform CVRMLImporter::Parse(const io::CURI &pURL)
{
    io::CFile lFile(pURL);
    std::size_t lFileSize=lFile.Size();
    io::PStream lS=io::open(pURL,io::EMode::READ);
    std::vector<char> lBuf(lFileSize);

    if(lS->Read((uint8_t*)lBuf.data(),lFileSize).Count()!=lFileSize)
        throw XIO("can't read iv file");

    vrml::CParser lParser;
    return lParser.Parse(lBuf);
}

/*namespace import*/ } /*namespace scene*/ } /*namespace buola*/ }
